﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.SX.PLXYY
{
    /// <summary>
    /// HuLiJiLuYi.xaml 的交互逻辑
    /// </summary>
    public partial class HuLiJiLuErCtrl : CustomCommonTableCtrl
    {
        public HuLiJiLuErCtrl()
        {
            InitializeComponent();
            DateTime rssjdata = DataManager.Instance.CurrentPatientLink.Status.InRoomTime;
            DateTime mzkssjdata = DataManager.Instance.CurrentPatientLink.Status.MazuiStartTime;
            DateTime sskssjdata = DataManager.Instance.CurrentPatientLink.Status.OperStartTime;
            DateTime mzjssjdata = DataManager.Instance.CurrentPatientLink.Status.MazuiEndTime;
            DateTime cssjdata = DataManager.Instance.CurrentPatientLink.Status.OutRoomTime;
                rssj.Text = rssjdata.Equals(new DateTime()) ? "" : rssjdata.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);
            mzkssj.Text = mzkssjdata.Equals(new DateTime())?"":mzkssjdata.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);
            sskssj.Text = sskssjdata.Equals(new DateTime())?"":sskssjdata .ToString(DateFormat.DATE_FORMAT_STR_YMDHM);
            mzjssj.Text = mzjssjdata.Equals(new DateTime())?"":mzjssjdata.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);
            cssj.Text = cssjdata.Equals(new DateTime())?"":cssjdata.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);
            this.Loaded += thisCtrl_Loaded;
        }


        private void thisCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            DataManager.Instance.IsNotNeedSaveData = false;
        }
        private void ssrq_GotFocus(object sender, RoutedEventArgs e)
        {
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                ssrq.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);//2005年11月5日
            }
        }
    }
}
